package com.medical.Mapper;


import com.medical.DTO.EmployeePageDTO;
import com.medical.DTO.LoginDTO;
import com.medical.Entity.User;
import com.medical.VO.EmployeeVO;
import com.medical.VO.LoginVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where username = #{username} and password = #{password}")
    LoginVO getByUsernameAndPassword(LoginDTO loginDTO);

    List<EmployeeVO> list(EmployeePageDTO pageDTO);

    @Insert("INSERT INTO user(username,name,gender,password,email,phone,status,role,create_time) values (#{username},#{name},#{gender},#{password},#{email},#{phone},#{status},#{role},#{createTime})")
    int add(User user);

    int delete(List<Integer> ids);

    int update(User user);

}
